%%This is a very basic article template.
%%There is just one section and two subsections.
\documentclass{article}

\usepackage{pgf-pie}

% urls
\usepackage[hyphens]{url}

% use of acronyms
\usepackage[printonlyused,withpage]{acronym}

% use of multirow
\usepackage{multirow}

% nice fonts for the math sets
\usepackage{amsfonts}

\usepackage[francais,english]{babel}

\usepackage[T1]{fontenc}

\begin{hyphenrules}{francais}
\hyphenation{pr\'e-f\'e-ren-ces}
\end{hyphenrules}

\usepackage{pgfplots}

\usepackage{graphicx}
\usepackage[hang,small,bf]{caption}
\usepackage{subfig}

\usepackage{lscape}
\usepackage{longtable}
\usepackage{rotating}

\usepackage{abstract}

\usepackage{tikz}
\usetikzlibrary{fit, arrows, decorations.markings,positioning,trees}

% use of listings
\usepackage{listings}
\usepackage{framed}
\usepackage{MnSymbol}
\lstset{
	language=SQL,
	basicstyle=\ttfamily\fontsize{8}{11}\selectfont,
	aboveskip=6pt plus 2pt, 
	belowskip=2pt plus 8pt,
	morekeywords={PREFIX,java,rdf,rdfs,url,xsd},
	numbers=left,
	numberstyle=\tiny,
}


% use of minitoc
\usepackage{shorttoc,titletoc}

\newcommand\partialtocname{Outline}
\newcommand\ToCrule{\noindent\rule[5pt]{\textwidth}{1.3pt}}
\newcommand\ToCtitle{{\large\bfseries\partialtocname}\vskip2pt\ToCrule}
\makeatletter
\newcommand\Mprintcontents{%
  \ToCtitle
  \ttl@printlist[chapters]{toc}{}{1}{}\par\nobreak
  \ToCrule}
\makeatother


\newcommand\TODO[1]{{\textcolor{red}{\underline{TODO}: #1\\}}}

\hyphenation{spe-ci-fic}


\begin{document}

\begin{tikzpicture}

\tikzstyle{state} = [rectangle,minimum width=50pt,minimum height=2pt,fill=black, inner sep=0pt] 
\tikzstyle{life} = [dashed]
\tikzstyle{label} = [inner sep=0pt,font=\footnotesize]
\tikzstyle{pool} = [rectangle,minimum height=10pt,inner sep=0pt,fill=black!60]
\tikzstyle{pool-label} = [inner sep=0pt,color=white]

\node[state] (search-service) {};

\node[below=300pt of search-service] (search-service-baseline) {};

\node[label,above=2pt of search-service] {search service}; 

\path[life] (search-service) edge (search-service-baseline);

\node[state,right=10pt of search-service] (search-executor) {};

\node[below=300pt of search-executor] (search-executor-baseline) {};


\path[life] (search-executor) edge (search-executor-baseline);

\node[label,above=2pt of search-executor] {search executor};

\node[below=20pt of search-executor] (search-plugins-slot-1) {};

\node[right=20pt of search-plugins-slot-1] (search-plugins-slot-2) {};

\node[right=20pt of search-executor-baseline] (search-plugins-slot-2-baseline) {};

\node[right=270pt of search-plugins-slot-2] (search-plugins-slot-3) {};

\node[right=130pt of search-plugins-slot-2] (search-plugins-slot-4) {};

\node[pool,fit=(search-plugins-slot-1)(search-plugins-slot-2)(search-plugins-slot-4)(search-plugins-slot-3)]
(search-plugins) {};

\node[pool-label,below=1pt] at (search-plugins.north) {\textbf{search plugins}};

\node[right=270pt of search-plugins-slot-2-baseline]
(search-plugins-slot-3-baseline) {};

\path[life] (search-plugins-slot-3) edge (search-plugins-slot-3-baseline);

\node[below=5pt of search-service] (search-service-call-1) {};

\node[below=5pt of search-executor] (search-executor-calling-1) {};

\path[->] (search-service-call-1) edge (search-executor-calling-1);

\node[state,below=20pt of search-plugins-slot-2] (pattern-plugin) {};

\node[label,above=2pt of pattern-plugin] {pattern plugin};

\node[right=20pt of search-executor-baseline] (pattern-plugin-baseline) {};

\path[life] (pattern-plugin) edge (pattern-plugin-baseline);

\node[state,right=10pt of pattern-plugin] (pattern-executor) {};

\node[label,above=2pt of pattern-executor] {pattern executor};

\node[below=250pt of pattern-executor] (pattern-executor-baseline) {};

\path[life] (pattern-executor) edge (pattern-executor-baseline);

\node[below=5pt of pattern-plugin] (pattern-plugin-call-1) {};

\node[below=5pt of pattern-executor] (pattern-executor-calling-1) {};

\path[->] (pattern-plugin-call-1) edge (pattern-executor-calling-1);

\node[below=10pt of pattern-executor-calling-1] (patterns-slot-1) {};

\node[right=50pt of patterns-slot-1] (patterns-slot-2) {};

\node[pool,fit=(patterns-slot-1)(patterns-slot-2)] (patterns) {};

\node[pool-label,below=1pt] at (patterns.north) {\textbf{patterns}};

\node[right=50pt of pattern-executor-baseline] (patterns-slot-2-baseline) {};

\path[life] (patterns-slot-2) edge (patterns-slot-2-baseline);

\node[state, below=15pt of patterns] (1-measure) {};

\node[label,above=2pt of 1-measure] {1-Measure};

\node[state, below=15pt of 1-measure] (top-k) {};

\node[label,above=2pt of top-k] {Top-k};

\node[state, below=15pt of top-k] (other-pattern) {};

\node[label,above=2pt of other-pattern] {\ldots};

\node[state,below=20pt of search-plugins-slot-4] (object-wrapper) {};

\node[label,above=2pt of object-wrapper] {object wrapper};

\node[below=250pt of object-wrapper] (object-wrapper-baseline) {};

\path[life] (object-wrapper) edge (object-wrapper-baseline);

\node[below=60pt of patterns-slot-2] (patterns-slot-2-call-1) {};

\node[below=90pt of object-wrapper] (object-wrapper-calling-1) {};

\path[->] (patterns-slot-2-call-1) edge (object-wrapper-calling-1);

\node[below=10pt of object-wrapper-calling-1] (internal-queries-slot-1) {};

\node[right=65pt of internal-queries-slot-1] (internal-queries-slot-2) {};

\node[pool,fit=(internal-queries-slot-1)(internal-queries-slot-2)] (internal-queries) {};

\node[below=135pt of internal-queries-slot-2] (internal-queries-slot-2-baseline) 
{};

\path[life] (internal-queries-slot-2) edge (internal-queries-slot-2-baseline);


\node[pool-label,below=1pt] at (internal-queries.north) {\textbf{internal queries}};

\node[right=27pt of internal-queries-slot-1] (internal-queries-slot-3) {};

\node[state,below=15pt of internal-queries-slot-3] (query-1) {};

\node[label,above=2pt of query-1] {query 1};

\node[state,below=15pt of query-1] (other-queries) {};

\node[label,above=2pt of other-queries] {\ldots};

\node[right=80pt of search-plugins-slot-4] (search-plugins-slot-5) {};

\node[state, below=20pt of search-plugins-slot-5] (query-scheduler) {};

\node[label,above=2pt of query-scheduler] {query scheduler};

\node[below=250pt of query-scheduler] (query-scheduler-baseline) {};

\path[life] (query-scheduler) edge (query-scheduler-baseline);

\node[below=50pt of internal-queries-slot-2] (internal-queries-call-1) {};

\node[below=165pt of query-scheduler] (query-scheduler-calling-1) {};

\path[->] (internal-queries-call-1) edge (query-scheduler-calling-1);

\node[right=20pt of search-plugins-slot-5] (search-plugins-slot-6) {};

\node[state, below=200pt of search-plugins-slot-6] (query-scheduler-1) {};

\node[above=2pt of query-scheduler-1,label] {query 1};

\node[state,below=15pt of query-scheduler-1] (other-query-scheduler) {};

\node[label,above=2pt of other-query-scheduler] {\ldots};

\node[below=230pt of search-plugins-slot-3] (answer-plugins-slot-1) {};

\node[right=60pt of answer-plugins-slot-1] (answer-plugins-slot-2) {};

\node[pool,fit=(answer-plugins-slot-1)(answer-plugins-slot-2)] (answer-plugins) {};

\node[pool-label,below=1pt] at (answer-plugins.north) {\textbf{answer plugins}};

\node[below=40pt of answer-plugins-slot-2] (answer-plugins-slot-2-baseline) {};

\path[life] (answer-plugins-slot-2) edge (answer-plugins-slot-2-baseline);

\node[right=27pt of answer-plugins-slot-1] (answer-plugins-slot-3) {};

\node[state,below=10pt of answer-plugins-slot-3] (result-1) {};

\node[label,above=2pt of result-1] {result 1};

\node[state,below=15pt of result-1] (other-results) {};

\node[label,above=2pt of other-results] {\ldots};

\node[fit=(search-service)(answer-plugins-slot-2-baseline)] (bloc-1) {};

\node[below=-10pt,minimum width=300pt, minimum height=50pt] at (bloc-1.south) (bloc-2) {};

\node[below=0pt] at (bloc-2.north) {\underline{Legend}};

\node[state,right=10pt] at (bloc-2.west) (state-legend) {};

\node[pool,below=10pt,minimum width=50pt] at (state-legend.south) (pool-legend) {};

\node[right=10pt] at (state-legend.east) {thread};

\node[right=10pt] at (pool-legend.east) {thread pool};

\end{tikzpicture}

\end{document}
